using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class WF_ActionMap : EntityTypeConfiguration<WF_Action>
    {
        public WF_ActionMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.WorkFlowTypeCode)
                .HasMaxLength(20);

            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Code)
                .HasMaxLength(20);

            this.Property(t => t.Object)
                .HasMaxLength(50);

            this.Property(t => t.Command)
                .HasMaxLength(50);

            this.Property(t => t.Param1)
                .HasMaxLength(50);

            this.Property(t => t.BackName)
                .HasMaxLength(50);

            this.Property(t => t.BackCode)
                .HasMaxLength(50);

            this.Property(t => t.BackObject)
                .HasMaxLength(50);

            this.Property(t => t.BackCommand)
                .HasMaxLength(50);

            this.Property(t => t.BackParam1)
                .HasMaxLength(50);

            this.Property(t => t.Param2)
                .HasMaxLength(50);

            this.Property(t => t.BackParam2)
                .HasMaxLength(50);

            this.Property(t => t.Param3)
                .HasMaxLength(50);

            this.Property(t => t.BackParam3)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("WF_Action");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.WorkFlowTypeCode).HasColumnName("WorkFlowTypeCode");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Object).HasColumnName("Object");
            this.Property(t => t.Command).HasColumnName("Command");
            this.Property(t => t.Param1).HasColumnName("Param1");
            this.Property(t => t.BackName).HasColumnName("BackName");
            this.Property(t => t.BackCode).HasColumnName("BackCode");
            this.Property(t => t.BackObject).HasColumnName("BackObject");
            this.Property(t => t.BackCommand).HasColumnName("BackCommand");
            this.Property(t => t.BackParam1).HasColumnName("BackParam1");
            this.Property(t => t.Param2).HasColumnName("Param2");
            this.Property(t => t.BackParam2).HasColumnName("BackParam2");
            this.Property(t => t.Param3).HasColumnName("Param3");
            this.Property(t => t.BackParam3).HasColumnName("BackParam3");
        }
    }
}
